package sso

import "strings"

// 此处加密算法没有详细写

type Encrypt struct {
	redundancy string
	separator  string
}

func NewEncrypt() *Encrypt {
	return &Encrypt{
		redundancy: "redundancy",
		separator:  ":",
	}
}

func (e *Encrypt) Encrypt(value string) string {
	return value + e.separator + e.redundancy
}

func (e *Encrypt) Decrypt(value string) string {
	return strings.Split(value, e.separator)[0]
}

var MyEncrypt = NewEncrypt()
